Skip to content

fix(agentic): preserve only unparseable tool arguments - #1951

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev
Aug 1, 2026
Merged

fix(agentic): preserve only unparseable tool arguments#1951
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev

Conversation

@wsp1911

@wsp1911 wsp1911 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Return provided_arguments only when a provider tool call could not be parsed and retain the complete raw payload.
  • Stop echoing already-parsed arguments for validation errors.
  • Cover both full raw-argument preservation and parsed-validation omission.

Type and Areas

Type:

Bug fix

Areas:

Rust core, tool contracts

Motivation / Impact

Parsed tool arguments are already available in the preceding assistant tool call, so repeating them in an error result wastes context and can duplicate sensitive input.

For malformed argument JSON, truncating the raw payload can hide the actual parse failure and resemble output truncation. The error path now preserves the complete raw provider payload only when no structured argument representation is available.

Verification

  • pnpm run fmt:rs
  • cargo test -p bitfun-agent-tools --test tool_contracts — 104 passed
  • cargo test -p bitfun-core error_result_ --lib — 2 passed
  • git diff --check

Reviewer Notes

  • provided_arguments is emitted only when ToolCall.is_error and raw_arguments is present.
  • No migration, user-visible copy, locale, or manual UI verification is required.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above.
  • User-facing strings, docs, and locales are unchanged.

- Return `provided_arguments` only when a provider tool call could not be parsed and retain the complete raw payload.
- Stop echoing already-parsed arguments for validation errors.
- Cover both full raw-argument preservation and parsed-validation omission.
@wsp1911
wsp1911 merged commit 2babc2d into GCWing:main Aug 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant